package com.example.markdownview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import br.tiagohm.markdownview.css.styles.Github
import kotlinx.android.synthetic.main.activity_main.*
import androidx.core.app.ComponentActivity.ExtraData
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import java.io.File


class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        markdown_view.addStyleSheet(Github())

        markdown_view.loadMarkdown(content)
//        markdown_view.loadMarkdownFromAsset("markdown1.md")
//        markdown_view.loadMarkdownFromFile(File())
//        markdown_view.loadMarkdownFromUrl("https://raw.githubusercontent.com/qinci/MarkdownEditors/master/README.md")
    }

    var content = "![image](https://www.baidu.com/img/bd_logo1.png)\n" +
            "\n" +
            "## MarkdownEditors\n" +
            "\n" +
            "[91市场下载地址](http://apk.91.com/Soft/Android/ren.qinc.markdowneditors-1-0.1.html)\n" +
            "\n" +
            "[百度应用下载地址](http://shouji.baidu.com/software/9609110.html)\n" +
            "\n" +
            "[应用宝市场下载地址](http://android.app.qq.com/myapp/detail.htm?apkName=ren.qinc.markdowneditors)\n" +
            "\n" +
            "[安卓市场下载地址](http://apk.hiapk.com/appinfo/ren.qinc.markdowneditors/1)\n" +
            "\n" +
            "[小米应用商店下载地址](http://app.mi.com/detail/422745)\n" +
            "\n" +
            "~~[应用下载](http://fir.im/mde)~~\n" +
            "\n" +
            "基于Android的Markdown编辑器\n" +
            "\n" +
            "> 第一个版本，可能存在bug，欢迎指正\n" +
            "\n" +
            "> 功能本身不难，但是细节很多\n" +
            "\n" +
            "> 部分界面和功能仿未开源的MarkdownX软件\n" +
            "\n" +
            "其他\n" +
            "---\n" +
            "用了MVP+Rxjava\n" +
            "\n" +
            "\n" +
            "使用的开源库\n" +
            "---\n" +
            "* glide\n" +
            "* rxjava\n" +
            "* butterknife\n" +
            "* numberprogressbar\n" +
            "* kprogresshud\n" +
            "* android-bottom-sheet\n" +
            "* marked\n" +
            "* FlycoSystemBar\n" +
            "* ExpandableLayout\n" +
            "* 编辑中的撤销和恢复已经提取为单独的库[AndroidEdit] (https://github.com/qinci/AndroidEdit)\n" +
            "\n" +
            "感谢\n" +
            "---\n" +
            "感谢默默为开源不遗余力做出努力的小伙伴，本项目是站在巨人的肩膀上。\n" +
            "\n" +
            "**欢迎star、fork**\n" +
            "\n" +
            "未完成的功能（后续版本要完成的功能）\n" +
            "---\n" +
            "\n" +
            "* 分享\n" +
            "\t* 分享为HTML\n" +
            "\t* 分享为长图片\n" +
            "* 相关设置\n" +
            "* 其他远程存储方式\n" +
            "* 其他界面细节\n" +
            "\n" +
            "已完成功能的截图\n" +
            "---\n" +
            "![Image](http://img4.imgtn.bdimg.com/it/u=2397021217,2305904155&fm=26&gp=0.jpg)\n" +
            "![Image](http://img2.imgtn.bdimg.com/it/u=2556812386,284842756&fm=26&gp=0.jpg)\n" +
            "![Image](http://img1.imgtn.bdimg.com/it/u=3714618146,288532403&fm=26&gp=0.jpg)\n" +
            "![Image](http://img4.imgtn.bdimg.com/it/u=3793231783,2394379549&fm=26&gp=0.jpg)\n" +
            "![Image](http://img4.imgtn.bdimg.com/it/u=1831349265,220626403&fm=26&gp=0.jpg)\n" +
            " \n" +
            "\n" +
            "#### 动态图\n" +
            "\n" +
            "![首页图片](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1571720471830&di=302e88708b5ae7b3306ae76b872f0d8f&imgtype=0&src=http%3A%2F%2Fcms-bucket.nosdn.127.net%2Fd52d422781cc4f278905587874bff93620171227173004.gif)\n" +
            "\n" +
            "\n" +
            "历史版本\n" +
            "---\n" +
            "[v0.1](https://github.com/qinci/MarkdownEditors/tree/v0.1)\n"
}
